<script>
import dmbForm from '@/components/DmbForm'
import { putUp } from '@/api/recive/putaway'
import { defaultForm, formBase, formItemStyle } from './config'

export default {
  name: 'PutAway',
  computed: {
    formItemStyle() {
      return formItemStyle
    }
  },
  data() {
    return {
      propsSearchForm: { ...defaultForm }
    }
  },
  components: { dmbForm },
  methods: {
    formBase() {
      return formBase
    },
    // 上架
    putAway() {
      putUp(this.propsSearchForm).then(() => {
        this.$message.success('上架成功!')
      })
    }
  }
}
</script>

<template>
  <div class="flex my-3">
    <dmb-form
      ref="form"
      :form-items="formBase()"
      :model-value="propsSearchForm"
      label-width="70px"
      :item-style="formItemStyle"
      @update="(row) => propsSearchForm = row"
      class="flex-1"
    />
    <div>
      <el-button type="success" @click="putAway">入库上架</el-button>
    </div>
  </div>
</template>

<style scoped lang="scss">

</style>
